home *** CD-ROM | disk | FTP | other *** search
/ Champak 148 / (Vol 148) Feb 07 2012.iso / Games / pet_1328.swf / scripts / DefineSprite_140 / frame_1 / DoAction.as
Text File  |  2012-02-07  |  845b  |  33 lines

  1. boneposx = getProperty(_root.boneposition, _X);
  2. boneposy = getProperty(_root.boneposition, _Y);
  3. boneposw = boneposx + getProperty(_root.boneposition, _width);
  4. boneposh = boneposy + getProperty(_root.boneposition, _height);
  5. dogx = getProperty(_root.dog, _X);
  6. dogy = getProperty(_root.dog, _Y);
  7. if(boneposx < dogx && dogx < boneposw && boneposy < dogy && dogy < boneposh)
  8. {
  9.    _root.dog.nose.gotoAndPlay(7);
  10. }
  11. else if(boneposx - 100 < dogx && dogx < boneposw + 100 && boneposy - 100 < dogy && dogy < boneposh + 100)
  12. {
  13.    with(_root.dog.nose)
  14.    {
  15.       gotoAndPlay(5);
  16.    }
  17. }
  18. else if(boneposx - 200 < dogx && dogx < boneposw + 200 && boneposy - 200 < dogy && dogy < boneposh + 200)
  19. {
  20.    with(_root.dog.nose)
  21.    {
  22.       gotoAndPlay(3);
  23.    }
  24. }
  25. else
  26. {
  27.    with(_root.dog.nose)
  28.    {
  29.       gotoAndPlay(1);
  30.    }
  31. }
  32. play();
  33.